package com.homework;

public class Homework08 {
    public static void main(String[] args) {
        Color col = Color.RED;
        col.show();
        switch (col) {
            case RED: {
                System.out.println("匹配到红色");
            }
            break;
            default: {
                System.out.println("没有匹配到颜色");
            }
        }
    }
}

interface IA {
    void show();
}

enum Color implements IA{

    RED(255, 0, 0),
    BULE(0, 0, 255),
    BLACK(0, 0, 0),
    YELLOW(255, 255, 0),
    GREEN(0, 255, 0);

    private int redValue;
    private int greenValue;
    private int blueValue;

    private Color(int redValue, int greenValue, int blueValue) {
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }


    @Override
    public void show() {
        System.out.println("属性为=" + " " + this.redValue + " " + this.greenValue + " " +this.blueValue);
    }
}

